package com.example.springboot_test.redis;

import cn.hutool.bloomfilter.BloomFilterUtil;
import com.google.common.hash.BloomFilter;
import com.google.common.hash.Funnels;

import java.nio.charset.Charset;

public class BloomFilterDemo{
    public static void main(String[] args) {
        BloomFilter<String> bloomFilter = BloomFilter.create(Funnels.stringFunnel(Charset.forName("utf-8")), 1000, 0.001);
        bloomFilter.put("abc");
        boolean abc = bloomFilter.mightContain("abc");
        if (abc){
            System.out.println("\"存在key\" = " + "存在key");
        }
    }
}
